import request from '../utils/request'

//查询群的信息
export const getGroupInfoApi = (id) => request.get('/groups/getGroupInfo', { params: { id } })

//获取用户加入的所有群聊
export const getGroupListApi = (id,groupId) => request.get('/groups', { params: { id, groupId } })

//获取所有群聊
export const getAllGroupListApi = () => request.get('/groups/getAll')


//通过关键字搜索群聊
export const searchGroupApi = (keyword) => request.get('/groups/search', { params: { keyword } })

//加入群聊
export const addGroupApi = (data) => request.post('/groups/addGroupInvitation', data)

//获得该用户的群聊邀请列表
export const getGroupInvitationListApi = (id) => request.get('/groups/getGroupInvitation', { params: { id } })


//同意群聊申请
export const agreeGroupInvitationApi = (data) => request.post('/groups/agreeGroupInvitation', data)

//拒绝群聊申请
export const refuseGroupInvitationApi = (data) => request.post('/groups/rejectGroupInvitation', data)